<script setup>
import { ref } from 'vue'
import Child from './components/Child.vue'
const money = ref(100)
const car = ref('小黄车')

// 父级组件接收子组件传出的数据
const changeMoney = (num) => {
  money.value = money.value - num
}
const changeCar = (name) => {
  car.value = name
}
</script>

<template>
  <div>爸爸</div>
  <div>儿子</div>
  <Child :money="money" :car="car" @change-money="changeMoney" @changeCar="changeCar"></Child>
</template>

<style scoped></style>
